package io.github.yotta.notice.sms.properties;

import io.github.yotta.notice.sms.aliyun.token.AliSmsToken;
import lombok.Data;

import java.io.Serializable;

/**
 * @author yotta
 * @date 2023/4/30 15:59
 */
@Data
public class AliSmsAccount implements Serializable {

    private String tenantId;

    /**
     * 阿里云短信服务的accessKey
     */
    private String accessKeyId;

    /**
     * 阿里云短信服务的accessKeySecret
     */
    private String accessKeySecret;

    private String regionId = "cn-hangzhou";

    public AliSmsToken toToken() {
        final AliSmsToken aliSmsToken = new AliSmsToken();
        aliSmsToken.setRegionId(regionId);
        aliSmsToken.setAccessKey(accessKeyId);
        aliSmsToken.setAccessSecret(accessKeySecret);
        return aliSmsToken;
    }

}
